package edu.sctu.practice.class02.shuqiqi.assign.assign03.Two;

/**
 * Created by admin on 2015/11/4.
 */
public class ComparableCircle extends Circle implements Comparable {

    double radius;

    public ComparableCircle(double radius) {
        this.radius = radius;
    }

    @Override
    public int compareTo(Object o) {
        if (getArea() > ((ComparableCircle) o).getArea()) {
            return 0;
        } else {
            return 1;
        }
    }

    public double getArea() {
        double area = Math.PI * radius * radius;
        System.out.println("面积："+area);
        return area;
    }
}

